using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using PolylineRouting;
using Microsoft.Xna.Framework.Graphics;

namespace GameStateManagementSample.Classes
{
    class Route
    {
        List<Vector2> Points;
        public Route()
        {
           
        }
        public Route(Vector2 start, Vector2 end, List<Vector2> points) 
        {
          Points =  RouteHelper.GetRoute(start, end, points);
        }
        public void Draw(SpriteBatch spriteBatch)
        {

            if (Points != null&&Points.Count>2)
            {
                Vector2 last = Points.First();
                foreach (var vect in Points.Skip(1))
                {
                    LineBatchTester.LineBatch.DrawLine(spriteBatch, Color.Red, vect, last);
                    last = vect;
                }
            }
        }
    }
}
